home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / daemons / nfs / nfs-serv.2be / nfs-serv / nfs-server-2.2beta16 / mount.x < prev    next >
Encoding:
Text File  |  1995-05-19  |  4.5 KB  |  174 lines

  1. %/*
  2. % * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  3. % * unrestricted use provided that this legend is included on all tape
  4. % * media and as a part of the software program in whole or part.  Users
  5. % * may copy or modify Sun RPC without charge, but are not authorized
  6. % * to license or distribute it to anyone else except as part of a product or
  7. % * program developed by the user or with the express written consent of
  8. % * Sun Microsystems, Inc.
  9. % *
  10. % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  11. % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  12. % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  13. % *
  14. % * Sun RPC is provided with no support and without any obligation on the
  15. % * part of Sun Microsystems, Inc. to assist in its use, correction,
  16. % * modification or enhancement.
  17. % *
  18. % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  19. % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  20. % * OR ANY PART THEREOF.
  21. % *
  22. % * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  23. % * or profits or other special, indirect and consequential damages, even if
  24. % * Sun has been advised of the possibility of such damages.
  25. % *
  26. % * Sun Microsystems, Inc.
  27. % * 2550 Garcia Avenue
  28. % * Mountain View, California  94043
  29. % */
  30.  
  31. %/*
  32. % * Copyright (c) 1985, 1990 by Sun Microsystems, Inc.
  33. % */
  34. %
  35. %/* from @(#)mount.x    1.3 91/03/11 TIRPC 1.0 */
  36.  
  37. /*
  38.  * Protocol description for the mount program
  39.  */
  40.  
  41. #ifdef RPC_HDR
  42. %#ifndef _rpcsvc_mount_h
  43. %#define _rpcsvc_mount_h
  44. #endif
  45.  
  46. const MNTPATHLEN = 1024;    /* maximum bytes in a pathname argument */
  47. const MNTNAMLEN = 255;        /* maximum bytes in a name argument */
  48. const FHSIZE = 32;        /* size in bytes of a file handle */
  49.  
  50. /*
  51.  * The fhandle is the file handle that the server passes to the client.
  52.  * All file operations are done using the file handles to refer to a file
  53.  * or a directory. The file handle can contain whatever information the
  54.  * server needs to distinguish an individual file.
  55.  */
  56. typedef opaque fhandle[FHSIZE];    
  57.  
  58. /*
  59.  * If a status of zero is returned, the call completed successfully, and 
  60.  * a file handle for the directory follows. A non-zero status indicates
  61.  * some sort of error. The status corresponds with UNIX error numbers.
  62.  */
  63. union fhstatus switch (unsigned fhs_status) {
  64. case 0:
  65.     fhandle fhs_fhandle;
  66. default:
  67.     void;
  68. };
  69.  
  70. /*
  71.  * The type dirpath is the pathname of a directory
  72.  */
  73. typedef string dirpath<MNTPATHLEN>;
  74.  
  75. /*
  76.  * The type name is used for arbitrary names (hostnames, groupnames)
  77.  */
  78. typedef string name<MNTNAMLEN>;
  79.  
  80. /*
  81.  * A list of who has what mounted
  82.  */
  83. typedef struct mountbody *mountlist;
  84. struct mountbody {
  85.     name ml_hostname;
  86.     dirpath ml_directory;
  87.     mountlist ml_next;
  88. };
  89.  
  90. /*
  91.  * A list of netgroups
  92.  */
  93. typedef struct groupnode *groups;
  94. struct groupnode {
  95.     name gr_name;
  96.     groups gr_next;
  97. };
  98.  
  99. /*
  100.  * A list of what is exported and to whom
  101.  */
  102. typedef struct exportnode *exports;
  103. struct exportnode {
  104.     dirpath ex_dir;
  105.     groups ex_groups;
  106.     exports ex_next;
  107. };
  108.  
  109. program MOUNTPROG {
  110.     /*
  111.      * Version one of the mount protocol communicates with version two
  112.      * of the NFS protocol. The only connecting point is the fhandle 
  113.      * structure, which is the same for both protocols.
  114.      */
  115.     version MOUNTVERS {
  116.         /*
  117.          * Does no work. It is made available in all RPC services
  118.          * to allow server reponse testing and timing
  119.          */
  120.         void
  121.         MOUNTPROC_NULL(void) = 0;
  122.  
  123.         /*    
  124.          * If fhs_status is 0, then fhs_fhandle contains the
  125.           * file handle for the directory. This file handle may
  126.          * be used in the NFS protocol. This procedure also adds
  127.          * a new entry to the mount list for this client mounting
  128.          * the directory.
  129.          * Unix authentication required.
  130.          */
  131.         fhstatus 
  132.         MOUNTPROC_MNT(dirpath) = 1;
  133.  
  134.         /*
  135.          * Returns the list of remotely mounted filesystems. The 
  136.          * mountlist contains one entry for each hostname and 
  137.          * directory pair.
  138.          */
  139.         mountlist
  140.         MOUNTPROC_DUMP(void) = 2;
  141.  
  142.         /*
  143.          * Removes the mount list entry for the directory
  144.          * Unix authentication required.
  145.          */
  146.         void
  147.         MOUNTPROC_UMNT(dirpath) = 3;
  148.  
  149.         /*
  150.          * Removes all of the mount list entries for this client
  151.          * Unix authentication required.
  152.          */
  153.         void
  154.         MOUNTPROC_UMNTALL(void) = 4;
  155.  
  156.         /*
  157.          * Returns a list of all the exported filesystems, and which
  158.          * machines are allowed to import it.
  159.          */
  160.         exports
  161.         MOUNTPROC_EXPORT(void)  = 5;
  162.  
  163.         /*
  164.          * Identical to MOUNTPROC_EXPORT above
  165.          */
  166.         exports
  167.         MOUNTPROC_EXPORTALL(void) = 6;
  168.     } = 1;
  169. } = 100005;
  170.  
  171. #ifdef RPC_HDR
  172. %#endif /*!_rpcsvc_mount_h*/
  173. #endif
  174.